package com.kbt.fragment;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import com.kbt.activity.R;
import com.kbt.activity.StoreActivity;
import com.kbt.base.BaseApplication;
import com.kbt.util.data.StaticData;
import com.kbt.util.tool.BtnSetting;

import java.util.HashMap;
import java.util.Map;


/**
 * @author zhgk
 * @package: com.kbt.fragment
 * @TODO: <请描述这个类是干什么的>
 * @data: 2015/8/12 8:41
 * @version: V1.0
 */
public class GoodCarEmptyFragment extends Fragment {

    /****
     * 创建视图时执行的操作
     *****/
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.good_car_empty, container, false);
    }



    /***
     * 启动时执行的操作
     */
    @Override
    public void onStart() {
        super.onStart();
        //绑定去逛逛按钮
        Button goShopBtn = (Button) getView().findViewById(R.id.empty_go_shopping);
        BtnSetting.setBtnBackground(goShopBtn, 2, Color.RED, Color.WHITE, 5);
        Map params = new HashMap<String, Object>();
        params.put("currentItem", StaticData.INDEX_HOME);
//        ClickStartActivityListener listener = new ClickStartActivityListener(getActivity(),
//                StaticData.STORE_ACTIVITY_CLASS, params);
        goShopBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), StoreActivity.class);
                BaseApplication.getInstance().currentItem=StaticData.INDEX_HOME;
                getActivity().startActivity(intent);
                BaseApplication.getInstance().activity.finish();
            }
        });

    }
}
